home *** CD-ROM | disk | FTP | other *** search
/ Aminet 45 / Aminet 45 (2001)(GTI - Schatztruhe)[!][Oct 2001].iso / Aminet / game / role / ldmud-3.2-bin.lha / mud / doc / efun / test_bit < prev    next >
Text File  |  2001-04-06  |  782b  |  25 lines

  1. SYNOPSIS
  2.         int test_bit(string str, int n)
  3.  
  4. DESCRIPTION
  5.         Return 0 or 1 of bit n was set in string str.
  6.         
  7.         Each character contains 6 bits. So you can store a value
  8.         between 0 and 63 in one character (2^6=64). Starting character
  9.         is the blank " " which has the value 0. The first character in
  10.         the string is the one with the lowest bits (0-5).
  11.  
  12. EXAMPLES
  13.         test_bit("_",5);
  14.         
  15.         Returns 1 because "_" stands for the number 63 and therefore
  16.         the 6th bit is set.
  17.         
  18.         test_bit(" ",3);
  19.         
  20.         Returns 0 because " " stands for 0 and no bit is set.
  21.  
  22. SEE ALSO
  23.         set_bit(E), clear_bit(E), last_bit(E), next_bit(E), count_bits(E),
  24.         and_bits(E), or_bits(E), xor_bits(E), invert_bits(E)
  25.